package com.jy.rhin.infra.repo.notfication.topic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jy.rhin.infra.repo.notfication.topic.po.TopicQueryPO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author WeiQ
 * @date 2022/6/28 17:13
 */
@Repository
public interface TopicQueryMapper extends BaseMapper<TopicQueryPO> {

    /**
     * 清除指定主题关联的所有查询过滤条件
     *
     * @param topicExp
     */
    @Delete("delete from t_notification_topic_query_filter where topic_exp = #{topicExp}")
    void removeQueryFilter(@Param("topicExp") String topicExp);

    /**
     * 清除指定主题关联的所有查询
     *
     * @param topicExp
     */
    @Delete("delete from t_notification_topic_query where topic_exp = #{topicExp}")
    void removeQuery(@Param("topicExp") String topicExp);

    /**
     * 清除指定主题的字段信息
     * @param topicExp
     */
    @Delete("delete from t_notification_topic_properties where topic_exp = #{topicExp}")
    void removeProperties(@Param("topicExp") String topicExp);

}
